import {useContext} from "react";
import {UserContext} from "../../context/index";

const Children = () => {
    const context = useContext(UserContext);

    const handleClick = () => {
        context[1]({name: "哈哈哈", age: 55})
    }
    return (
        <div>
            <h1>姓名：{context[0].name}</h1>
            <h1>年龄：{context[0].age}</h1>
            <button onClick={handleClick}>修改</button>
        </div>
    )
}
export default Children
